import requests
from requests.packages import urllib3
import json

urllib3.disable_warnings()
data = {'rp': 50, 'listed': 'Y'}
req = requests.post('https://www.jisilu.cn/data/cbnew/cb_list/', data=data, verify=False)
print(req)
js = json.loads(req.text)
rows = js['rows']
print(js['total'])
# print(js['rows'][0])
# print(js['rows'][0]['cell']['bond_id'])
# print(js['rows'][0]['cell']['bond_nm'])
# for row in rows[:10]:
for row in rows:
    cell = row['cell']
    if float(cell['price']) < 160.0 :
        print(
            'code=%s name1=%s price1=%s per1=%s code2=%s name2=%s per2=%s yjl=%s synx=%s hsl=%s shsy=%s dblow=%s convert_dt=%s  force_redeem=%s' % (
                cell['bond_id'],
                cell['bond_nm'],
                cell['price'],
                cell['increase_rt'],
                cell['stock_id'],
                cell['stock_nm'],
                cell['sincrease_rt'], cell['premium_rt'], cell['year_left'], cell['turnover_rt'], cell['ytm_rt_tax'],
                cell['dblow'], cell['convert_dt'], cell['force_redeem']))
